/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ats.org.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author ghanem
 */
@Embeddable
public class GenCityPK implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Basic(optional = false)
    @NotNull
    @Column(name = "COUNTRY_NO")
    private short countryNo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "CITY_NO")
    private short cityNo;

    public GenCityPK() {
    }

    public GenCityPK(short countryNo, short cityNo) {
        this.countryNo = countryNo;
        this.cityNo = cityNo;
    }

    public short getCountryNo() {
        return countryNo;
    }

    public void setCountryNo(short countryNo) {
        this.countryNo = countryNo;
    }

    public short getCityNo() {
        return cityNo;
    }

    public void setCityNo(short cityNo) {
        this.cityNo = cityNo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) countryNo;
        hash += (int) cityNo;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof GenCityPK)) {
            return false;
        }
        GenCityPK other = (GenCityPK) object;
        if (this.countryNo != other.countryNo) {
            return false;
        }
        if (this.cityNo != other.cityNo) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ats.edugate.model.entities.GenCityPK[ countryNo=" + countryNo + ", cityNo=" + cityNo + " ]";
    }
    
}
